package com.kymatrix.kycarbon.xsmd.common.constants;


/**
 * 常量类
 */
public class Constant {

    public static final String SUCCESS = "success";
    public static final String FAILED = "failed";
    
    public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
    public static final Integer SC_UNAUTHORIZED_ERROR_401 = 401;
    public static final Integer SC_OK_200 = 200;
    
    public static final String HEADER_TENANT_ID = "tenant-id";
    

    private Constant() {
        throw new IllegalStateException(FAILED);
    }

    /**
     * 删除标识
     */
    public static final int DEL_FLAG_NORMAL = 0;
    public static final int DEL_FLAG_DELETE = 1;

    public static final String REQUEST_ATTRIBUTE_COMMON_RESULT = "common_result";
    public static final String ATTRIBUTE_HANDLER_METHOD = "HANDLER_METHOD";


    /**
     * @author liujie
     * @date 2024-04-17
     */
    public static class RedisKeyConstants {
        
        
        public static final String MODULE_LIST = "moduleList";
        
    }

    /**
     * Web 过滤器顺序的枚举类，保证过滤器按照符合我们的预期
     */
    public static class WebFilterOrderConstants {
    

        public static final int REQUEST_BODY_CACHE_FILTER = -110;
    
        // OrderedRequestContextFilter 默认为 -105，用于国际化上下文等等

        public static final int TENANT_CONTEXT_FILTER = -104; // 需要保证在 ApiAccessLogFilter 前面


        public static final int TENANT_SECURITY_FILTER = -102; // 需要保证在 Spring Security 过滤器前面
    
        // Spring Security Filter 默认为 -100，可见 org.springframework.boot.autoconfigure.security.SecurityProperties 配置属性类

        public static final int OPERATE_LOG_FILTER = -99; // 需要保证在 Spring Security Filter 后面

        public static final int FLOWABLE_FILTER = -98; // 需要保证在 Spring Security 过滤后面

    
    }
}
